package main

import (
	"flag"
	"fmt"
	"log"
	"net/http"
	"time"
)

func main() {

	addr := flag.String("addr", ":9090", "listen addr")
	flag.Parse()

	http.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) {
		w.Write([]byte(fmt.Sprintf("ping ping ping ! %s \n", time.Now().Format("2006-01-02 15:04:05"))))
	})
	err := http.ListenAndServe(*addr, nil)
	if err != nil {
		log.Fatal("ListenAndServe: ", err)
	}

}
